package cn.stylefeng.guns.modular.business.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 用户交易记录
 * </p>
 *
 * @author pzp
 * @since 2019-08-03
 */
@Data
@TableName("c_user_transaction_log")
public class UserTransactionLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "order_id", type = IdType.AUTO)
    private Integer orderId;

    /**
     * 订单号
     */
    @TableField("order_no")
    private String orderNo;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 交易方式：0：支付宝，1：微信，2：银行卡，3 余额
     */
    @TableField("pay_mode")
    private Integer payMode;

    /**
     * 开户行
     */
    @TableField("bank")
    private String bank;

    /**
     * 账户
     */
    @TableField("account")
    private String account;

    /**
     * 交易金额
     */
    @TableField("amount")
    private BigDecimal amount;

    /**
     * 手续费
     */
    @TableField("procedure_fee")
    private BigDecimal procedureFee;

    /**
     * 实际到账金额
     */
    @TableField("actual_amount")
    private BigDecimal actualAmount;

    /**
     * 处理状态：0：提交，1：处理中，2：成功，3：失败
     */
    @TableField("state")
    private Integer state;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 是否删除
     */
    @TableField("delete_flag")
    private Integer deleteFlag;

    /**
     * 类型：0：提现，1：升级等级
     */
    @TableField("type")
    private Integer type;

    /**
     * 第三方支付系统返回的流水号
     */
    @TableField("pay_no")
    private String payNo;
    /**
     * 第三方支付系统返回的时间
     */
    @TableField("pay_time")
    private Date payTime;

    /**
     * 如果是升级订单，那么记录升级订单的等级
     */
    @TableField("to_level")
    private Integer toLevel;

    @Override
    public String toString() {
        return "UserTransactionLog{" +
        "orderId=" + orderId +
        ", orderNo=" + orderNo +
        ", userId=" + userId +
        ", payMode=" + payMode +
        ", bank=" + bank +
        ", account=" + account +
        ", amount=" + amount +
        ", procedureFee=" + procedureFee +
        ", actualAmount=" + actualAmount +
        ", state=" + state +
        ", createTime=" + createTime +
        ", updateTime=" + updateTime +
        ", deleteFlag=" + deleteFlag +
        "}";
    }
}
